package icu.xuyijie.springbootlearning1.chapter4.async;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author 徐一杰
 * @date 2025/03/06 13:46
 * @description
 */
@Component
public class AsyncTest {

    @Async
    public void method1() {
        try {
            Thread.sleep(10000);
            System.out.println(Thread.currentThread().getName() + "子线程执行完毕");
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

}
